import http from './axios'
import type { LoginForm, RegisterForm, ResponseBody } from '@/types/SharedTypes'

export class UserService {

  static login = async (request: LoginForm): Promise<ResponseBody> => {
    const response = await http({
      method: 'POST',
      url: '/api/user/v1/login',
      data: request
    })
    return response.data
  }

  static register = async (request: RegisterForm): Promise<ResponseBody> => {
    const response = await http({
      method: 'POST',
      url: '/api/user/v1/register',
      data: request
    })
    return response.data
  }
}